<include file="Public:header"/>
<form action="" method="post" class="ajax-form">
<div class="form_data">
	<div class="mod_name">
		<span class="name">
			<eq name="info.id" value="">添加<else/>修改</eq>角色
		</span>
	</div>

	<div class="mod_data">
		<div class="name">名称</div>
		<div class="input_data">
			<input type="text" name="title" value="{$info['title']}" datatype="*">
		</div>
	</div>
	<div class="mod_data">
		<div class="name">选择可操作权限</div>
		<div class="input_data">
			<span style="color:#0000FF;cursor:pointer;" onclick="$.checkbox(this,'div',true)">全选</span> /
			<span style="color:#0000FF;cursor:pointer;" onclick="$.checkbox(this,'div',false)">反选</span>
		</div>
	</div>

	<volist name="menu_info" id="row" key="b">
	<php> $module = $key;</php>
	<php> $cur_auths = $info['auths'][$module];</php>
	<div class="mod_name">
		<span class="name">
			{$row['title']}
		</span>
	</div>
	<volist name="row.list" id="vo" key="k">
	<div class="mod_data">
		<div class="name">
			<label>
				<input type="checkbox" class="checkbox" onclick="$.checkbox(this,'#role-{$b}{$k}');">
				{$vo['title']}
			</label>
		</div>
		<div class="input_data" id="role-{$b}{$k}">
			<volist name="vo['list']" id="ks" key="o">
			<label>
				<php>
					$is_checked = in_array($ks['url'], $cur_auths);
				</php>
				<input type="checkbox" class="checkbox" name="auths[{$module}][]" onclick="$.checkbox(this,'#role-opt-{$b}-{$k}-{$o}');" <eq name="is_checked" value="true">checked</eq> value="{$ks['url']}">
				{$ks['title']}
			</label>

			<php>
				if($ks['filter_list']){
					echo '<span id="role-opt-' . $b . '-' . $k . '-'  . $o . '">(';
				}
				foreach($ks['filter_list'] as $ots){
			</php>
			<label>
				<php> $is_checked = in_array($ots['url'],$cur_auths);</php>
				<input type="checkbox" class="checkbox" name="auths[{$module}][]" <eq name="is_checked" value="true">checked</eq> value="{$ots['url']}">
				{$ots['title']}
			</label>
			<php>
				}
				if($ks['filter_list']){
				echo ')</span>';
				}
			</php>
			<br>
			
			</volist>
		</div>
	</div>
	</volist>
	</volist>

	<div class="mod_submit">
		<input type="hidden" name="id" value="{$info['id']}">
		<button type="submit" class="btn btn-save">保存</button>
		<button type="reset" class="btn btn-reset">重置</button>
		<button class="btn btn-back">返回</button>
	</div>
</div>
</form>
<include file="Public:footer"/>